import React from "react";
import { ScrollView, View } from "@tarojs/components"

interface IBasePageProps {
    classNames?: string
    children: React.ReactNode
}

type IPageProps = IBasePageProps;

export const TPage = (props: IPageProps) => {
    const { classNames, children } = props
    return (
        <ScrollView
            className="h-[100%]  pb-[150px]"
            scrollAnchoring
            scrollY
            enhanced
            bounces
            refresherEnabled
            refresherDefaultStyle='none'
            refresherBackground='#121325'
            enablePassive={true}
            scrollWithAnimation
            disableLowerScroll='always'
            disableUpperScroll='always'
            cacheExtent={1}
            trapScroll={'true'}
        >
            <View id="tpage" className={`w-full h-full bg-page overflow-y-scroll pt-[90px] pb-[100px] flex flex-col relative ${classNames}`} >
                {children}
            </View>
        </ScrollView >
    )
}   